package shizhan.service;

import org.springframework.stereotype.Component;
import shizhan.dao.RoleDao;
import shizhan.dao.RoleDaoImpl;
import shizhan.entity.Role;

import javax.annotation.Resource;


@Component("roleDao")
public class RoleServiceImpl implements RoleService{

    @Resource(type = RoleDaoImpl.class)
    RoleDao dao;

    public RoleServiceImpl() {
    }

    public RoleServiceImpl(RoleDao dao) {
        this.dao = dao;
    }

    @Override
    public void speak(Role role) {
        dao = new RoleDaoImpl();
        dao.speak(role);
    }

    public void setDao(RoleDaoImpl dao) {
        this.dao = dao;
    }
}